%-*-Erlang-*-
% vim: ft=erlang

{erl_opts, [
    debug_info,
    warn_unused_vars,
    warn_unused_import,
    warn_exported_vars,
    {parse_transform, lager_transform},
    {parse_transform, cut},
    {parse_transform, do},
    {parse_transform, import_as}
]}.

{deps, [
    %% maintained by CB team
    {boss_db,               ".*",   {git, "https://github.com/ErlyORM/boss_db.git",           {tag, "0.9.0"}}},
    {tinymq,                ".*",   {git, "https://github.com/ChicagoBoss/tinymq.git",        {tag, "v0.9.0"}}},
    %% WARNING: Do not add cb_admin dependency here, otherwise you'll
    %% encounter a dependency loop with rebar.  cb_admin should be added to
    %% YOUR APPS's rebar.config

    %% maintained by others
    {erlydtl,               {git, "https://github.com/erlydtl/erlydtl.git",             {ref, "118c176"}}},
    %{jaderl,                {git, "https://github.com/erlydtl/jaderl.git",             {ref, "14a80dafd"}}},
    {gen_smtp,              {git, "https://github.com/Vagabond/gen_smtp.git",           {tag, "0.11.0"}}},
    {iso8601,               {git, "https://github.com/danikp/erlang_iso8601.git",       {ref, "ae6a052017"}}},
    {mimetypes,             {git, "https://github.com/spawngrid/mimetypes.git",         {branch, master}}},

    %% webservers of choice, mochiweb and cowboy installed by default
    {mochiweb,              {git, "https://github.com/mochi/mochiweb.git",              {ref, "53a9607"}}},
    {cowboy,                {git, "https://github.com/ninenines/cowboy.git",            {tag, "2.6.1"}}},
    %% webmachine still requires dispacher to be written for it
    %{webmachine,            {git, "https://github.com/webmachine/webmachine.git",      {ref, "086bd10920"}}},
    %% yaws requires libpam0g-dev, for ubuntu install it with 'sudo apt-get install libpam0g-dev'
    %{yaws,                  {git, "https://github.com/klacke/yaws.git",                {tag, "yaws-2.0"}}},
    {simple_bridge,         {git, "https://github.com/nitrogen/simple_bridge.git",      {ref, "1938ec7"}}}

    %%% EXPERIMENTAL %%%
    %% Uncomment the following line if you want LFE support
    %% See README_LFE for more details.
    %{lfe,                   {git, "https://github.com/rvirding/lfe.git",               {ref, "fb7c96eb17"}}},

    %% Uncomment the following line if you want Elixir support
    %% Then copy priv/elixir to src/ in this directory, run "mix deps.get", and recompile
    %% See README_ELIXIR for more details.
    %{elixir,               {git, "https://github.com/elixir-lang/elixir.git",          {tag, "v1.1.1"}}},

    %% The following apps are dependencies that are already brought in by
    %% boss_db being a dependency, but are still used by ChicagoBoss directly.
    %%  Listed here just for just as an FYI:
    %{tiny_pq,               {git, "https://github.com/ChicagoBoss/tiny_pq.git",       {tag, "v0.8.15"}}},
    %{poolboy,               {git, "https://github.com/devinus/poolboy.git",           {ref, "64e1eaef0b"}}},
    %{proper,                {git, "https://github.com/manopapad/proper.git",          {ref, "d90fc40579"}}},
    %{lager,                 {git, "https://github.com/basho/lager.git",               {tag, "2.0.3"}}},
    %{erlando,               {git, "https://github.com/travelping/erlando.git",        {ref, "23d678c97"}}},
  ]}.

{template_dir, "."}.
{lib_dirs, ["deps/elixir/lib", "deps"]}.

{erlydtl_opts, [
    {doc_root, "src/boss"},
    {out_dir, "ebin"},
    {source_ext, ".dtl"},
    {module_ext, ""},
    {compiler_options, [debug_info]},
    report,
    return
]}.

%% == Dialyzer ==
{dialyzer, [
    {warnings, [error_handling, race_conditions, unmatched_returns, underspecs]},
    {get_warnings, false},
    {plt_apps, top_level_deps}, % top_level_deps | all_deps
    {plt_extra_apps, []},
    {plt_location, local}, % local | "/my/file/name"
    {plt_prefix, "boss"},
    {base_plt_apps, [stdlib, kernel, erts]},
    {base_plt_location, global}, % global | "/my/file/name"
    {base_plt_prefix, "rebar3"}
]}.

{cover_enabled, true}.

{plugins, [rebar3_proper]}.

{profiles,
    [{test, [
        {deps, [
            {proper, "1.1.1-beta"}
        ]}
    ]},
    {boss_test, [
         {erl_opts, [{d, boss_test}]}
    ]},
    {prod, [
        %{erl_opts, [warnings_as_errors]}
    ]}
]}.
